{extend name='base@layout/base' /}
{block name='title'}货物管理{/block}
{block name='pageTitle'}
<div class="page-title">
    <div class="breadcrumb-env pull-left">
        <ol class="breadcrumb bc-1">
            <li>
                <a href="{:url('/base/Index/index')}"><i class="fa-home"></i>首页</a>
            </li>
            <li>
                <a href="javascript:;">基本设置</a>
            </li>
            <li class="active">
                <strong>货物管理</strong>
            </li>
        </ol>
    </div>
</div>
{/block}
{block name='content'}
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <!--统计总数和添加按钮-->
            <div class="panel-heading btn-toolbar">
                <!--<div class="btn-group focus-btn-group pull-right">-->
                    <!--<button class="btn btn-default btn-primary" onclick="showAjaxModal();">-->
                        <!--<span class="fa-plus"></span> 添 加-->
                    <!--</button>-->
                <!--</div>-->
                <div class="btn-group dropdown-btn-group pull-left">
                    <button class="btn btn-default btn-primary">
                        <span class="fa-database"></span>&nbsp;&nbsp;&nbsp;&nbsp;共有<span style="font-weight:">&nbsp;{$count}&nbsp;</span>个货物
                    </button>
                </div>
            </div>
            <div class="panel-body">
                <!-- searach -->
                <div class="btn-toolbar">
                    <form action="" method="get" class="form-inline" style="margin-bottom:15px;" class="search-tool">
                        <span>
                            <label class="control-label">货物名称</label>
                            <input type="text" class="form-control" placeholder="货物名称" name="name" value="{$Request.get.name}">
                        </span>

                        <span style="margin-left: 15px;">
                            <label class="control-label">货物状态</label>
                            <select class="form-control" name="status">
                                <option value="-1" {eq name="Request.get.status" value="-1"} selected="selected" {/eq}>全部</option>
                                <option value="0" {eq name="Request.get.status" value="0"} selected="selected" {/eq}>作废</option>
                                <option value="1" {eq name="Request.get.status" value="1"} selected="selected" {/eq}>预采购</option>
                                <option value="2" {eq name="Request.get.status" value="2"} selected="selected" {/eq}>已采购</option>
                                <option value="3" {eq name="Request.get.status" value="3"} selected="selected" {/eq}>已出库</option>
                            </select>
                        </span>

                        <span style="margin-left: 15px;">
                            <button class="btn btn-default btn-primary" type="submit" style="margin-top:10px;">
                                <span class="fa-search"></span> 搜 索
                            </button>
                        </span>
                    </form>
                </div>
                <!-- searach -->
                <table cellspacing="0" class="table table-small-font table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>货物名称</th>
                        <th>供应商</th>
                        <th>仓库</th>
                        <th>顾客</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>总价</th>
                        <th>状态</th>
                        <th>创建时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name='list' id='data'}
                    <tr>
                        <td> {$data.category.name} </td>
                        <td> {$data.supplier.name} </td>
                        <td> {$data.storage.name} </td>
                        <td>
                            {switch $data.customer_id}
                                {case 1}学生{/case}
                                {case 2}教师{/case}
                            {/switch}
                        </td>
                        <td> {$data.price} </td>
                        <td> {$data.num} </td>
                        <td> {$data.total} </td>
                        <td>
                            {switch $data.status}
                                {case 0}作废{/case}
                                {case 1}预采购{/case}
                                {case 2}已采购{/case}
                                {case 3}出库{/case}
                            {/switch}
                        </td>
                        <td> {$data->add_time} </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                <!--分页-->
                <ul class="pagination no-margin pull-right">
                    {$list|raw}
                </ul>
                <!--分页 end-->
            </div>
        </div>
    </div>
</div>
{/block}